//
//  BarometricPressureDataModel.swift
//  TimeBoat
//
//  Created by Jun on 2022/9/8.
//  Copyright © 2022 Time Boat. All rights reserved.
//

import Foundation

/// 气压检测
@objcMembers class BarometricPressureDataModel: NSObject {
    /// 气压测量
    var barometricMeasurement: Int32 = 0

    /// 高度
    var height: Int32 = 0
    
    convenience init(buf: [UInt8]) {
        self.init()
        
        if (buf.count >= 8) {
            barometricMeasurement = Int32.toInt32(buf: buf, offset: 0)
            height = Int32.toInt32(buf: buf, offset: 4)
        }
    }
    
    @objc func toString() -> String {
        var str = self.yy_modelToJSONString()
        if nil == str {
            str = ""
        }
        
        return str!
    }
}
